<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:fragment="head(title)">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title th:replace="${title}">博客详情</title>
    <!-- 引入semantic-ui的css -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
    <!-- 引入中文布局的css -->
    <link rel="stylesheet" th:href="@{/css/typo.css}">
    <!-- 引入动画的css -->
    <link rel="stylesheet" th:href="@{/css/animate.css}">
    <!-- 引入prism代码高亮的css -->
    <link rel="stylesheet" th:href="@{/lib/prism/prism.css}">
    <!-- 引入目录生成工具的css -->
    <link rel="stylesheet" th:href="@{/lib/tocbot/tocbot.css}">
    <link rel="stylesheet" th:href="@{/css/me.css}">
    <!-- 引入 layui.css -->
    <link rel="stylesheet" href="//unpkg.com/layui@2.6.8/dist/css/layui.css">
    <link rel="shortcut icon" th:href="@{/images/logo.png}" type="image/x-icon">



    <!-- 引入jquery和semantic-ui的js文件 -->
    <script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/jquery.scrollto@2.1.3/jquery.scrollTo.min.js"></script>
    <script src="//unpkg.com/layui@2.6.8/dist/layui.js"></script>
    <!-- 引入prism代码高亮的js -->
    <script th:src="@{/lib/prism/prism.js}"></script>
    <!-- 引入生成目录的js -->
    <script th:src="@{/lib/tocbot/tocbot.min.js}"></script>
    <!-- 引入生成二维码的js -->
    <script th:src="@{/lib/qrcode/qrcode.min.js}"></script>
</head>
<body>
<!-- 导航 -->
<nav th:fragment="menu(n)" class="ui inverted attached segment m-padded-td m-shadow-small">
    <span id="isLogin" hidden th:text="${session.loginUser}"></span>
    <div class="ui container">
        <div class="ui inverted secondary stackable menu">
            <a style="text-decoration: none" href="/blog/getAllBlog/0/9"><h2 class="ui teal header item">小千百</h2></a>
            <a th:href="@{/index}" class="m-item item m-mobile-hide" th:classappend="${n==1} ? 'active'"><i class="home icon"></i>首页</a>
            <a th:href="@{/type/goTypesPage/-1/0/5}" class="m-item item m-mobile-hide" th:classappend="${n==2} ? 'active'"><i class="idea icon"></i>分类</a>
            <a th:href="@{/tag/goTagsPage/-1/0/5}" class="m-item item m-mobile-hide" th:classappend="${n==3} ? 'active'"><i class="tags icon"></i>标签</a>
            <a th:href="@{/archives/archivesPage}" class="m-item item m-mobile-hide" th:classappend="${n==4} ? 'active'"><i class="clone icon"></i>归档</a>
            <a id="editBlog" href="#" class="m-item item m-mobile-hide" th:classappend="${n==5} ? 'active'"><i class="edit icon"></i>写博客</a>
            <div class="right m-item item m-mobile-hide">
                <form name="search" action="/blog/searchBlog" method="post">
                    <div class="ui icon  input">
                        <input name="query" type="text" placeholder="Search...." />
                        <i onclick="document.forms['search'].submit()" class="search link icon"></i>
                    </div>
                </form>

                <a th:href="@{/login}" th:if="${session.loginUser} == null" class="m-item item m-mobile-hide"><i class="user large icon"></i></a>

                <div class="ui inline dropdown item" th:unless="${session.loginUser} == null">
                    <div class="text">
                        <img id="userAvatarUrl" th:src="@{${session.loginUser.avatarUrl}}" style="width: 29px; !important;"  class="ui avatar image">
                        [[${session.loginUser.nikeName}]]
                    </div>
                    <i class="dropdown icon"></i>
                    <div class="menu">
                        <a th:href="@{'/user/myself/' + ${session.loginUser.id}}" class="item"><i class="spy icon"></i>个人中心</a>
                        <a id="logout" href="#" class="item"><i class="sign out icon"></i>注销</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <a href="#" class="ui menu toggle black icon button m-right-top m-mobile-show">
        <i class="sidebar icon"></i>
    </a>
    <script>
        // 下拉框激活
        $('.ui.dropdown').dropdown({
            on: 'hover'
        });

        $("#logout").click(function () {
            $.getJSON('/logout',function (data) {
                if (data === 200) {
                    // 注销成功，刷新当前页面
                    location.reload();
                }
            })
        })
    </script>
</nav>


<!-- 底部footer -->
<footer th:fragment="footer" class="ui inverted vertical segment m-padded-td-massive">
    <div class="ui center aligned container">
        <div class="ui inverted divided stackable grid">
            <div class="three wide column">
                <div class="ui inverted link list">
                    <div class="item">
                        <img th:src="@{/images/wechat.jpg}" class="ui rounded image" alt="" style="width: 110px;">
                    </div>
                </div>
            </div>
            <div class="four wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced ">推荐</h4>
                <div class="ui inverted link list">
                    <a th:href="#{footer.recommended.markdown}" class="item" target="_blank">Markdown语法</a>
                    <a th:href="#{footer.recommended.front}" class="item" target="_blank">前端学习路线</a>
                    <a th:href="#{footer.recommended.back}" class="item" target="_blank">后端学习路线</a>
                </div>
            </div>
            <div class="four wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced ">联系我</h4>
                <div class="ui inverted link list">
                    <a href="#" class="item" th:text="#{footer.email}"></a>
                    <a href="#" class="item" th:text="#{footer.qq}"></a>
                </div>
            </div>
            <div class="five wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced ">该网站</h4>
                <p m-text-thin m-text-spaced m-opacity-mini>这是我的个人博客、会分享关于编程、协作、思考相关的任何内容，希望可以给来到这儿的人有所帮助...</p>
            </div>
        </div>
        <div class="ui inverted section divider"></div>
        <p m-text-thin m-text-spaced m-opacity-tiny>Copyright &copy; 2021-2021 srgstart All Rights Reserved V.3.1.5
            豫ICP备2021009487号</p>
    </div>
</footer>


</body>
</html>